<?php

class MySql implements IDatabase

{

    private $conexion;

    public function __construct($Db_Server, $Db_User, $Db_Pass, $Db_Name) {
        if (!isset($this->conexion)) {
            $this->conexion = (mysql_connect($Db_Server, $Db_User, $Db_Pass)) or die(mysql_error());
            mysql_select_db($Db_Name, $this->conexion) or die(mysql_error());
        }
    }

    public function Fetched_Query($Consulta) {
        $consulta = mysql_query($Consulta, $this->conexion);
        $resultado = array();
        while ($row = mysql_fetch_array($consulta)) {
            array_push($resultado, $row);
        }
        if (!$consulta) {
            throw new Exception("Error Sql" . mysql_error());
        }
        return $resultado;
        mysql_close();
    }

    public function Non_Fetched_Query($Consulta) {
        mysql_query($Consulta, $this->conexion);
        mysql_close();
    }
    
    public function Execute_Stored_Procedure($Store_Procedure)
    {}

}

?>
